package com.definity.toolkit.web.taglib;

import java.util.List;

import javax.servlet.http.HttpServletRequest;


public class SelectEnumListTag extends SelectEnumTag {

	private static final long serialVersionUID = 2068485521243135587L;

	private String list;
	
	public SelectEnumListTag() {

	}
	
	public void setList(String list) {
		this.list = list;
	}

	@Override
	@SuppressWarnings("unchecked")
	protected Object[] getValues(Class<?> enumType) {
		HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
		List<Object> attribute = (List<Object>) request.getAttribute(list);
		return attribute.toArray();
	}
	
}
